package com.ss.android.newmedia.feedback;

import android.graphics.Bitmap;
import android.os.Message;

import com.bytedance.common.utility.b.ThreadPlus;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;

final class u extends ThreadPlus {
    private final SubmitFeedbackActivity c;
    private final String a;
    private final String b;

    u(SubmitFeedbackActivity arg1, String arg2, String arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void run() {
        int v4 = 80;
        Bitmap v0 =  android.support.design.a.a(this.c.e, 1000, false);
        int v1 =  android.support.design.a.e(this.c.e);
        if(v0 != null) {
            ByteArrayOutputStream v2 = new ByteArrayOutputStream();
            v0.compress(Bitmap.CompressFormat.JPEG, v4, ((OutputStream)v2));
            android.support.design.a.a(v2.toByteArray(), this.c.h, this.c.i);
            v0.recycle();
            this.c.e = this.c.h + "/" + this.c.i;
            if(v1 == 0) {
            }else {

                try {
                    v0 = android.support.design.a.a(this.c.e, 1000, false);
                    if (v0 == null) {
                    } else {
                        Bitmap v1_1 = android.support.design.a.a(v0, v1);
                        if (v1_1 != v0) {
                            v0.recycle();
                        }

                        if (v1_1 == null) {
                        } else {
                            v1_1.compress(Bitmap.CompressFormat.JPEG, 80, new FileOutputStream(this.c.e));
                            v1_1.recycle();
                        }
                    }
                } catch (FileNotFoundException v0_1) {
                    v0_1.printStackTrace();
                } catch (OutOfMemoryError v0_2) {
                    v0_2.printStackTrace();
                }
            }
        }

        m v0_3 = new m();
        v0_3.b = this.c.d;
        v0_3.a = this.a;
        v0_3.c = this.b;
        v0_3.d = this.c.e;
        Message v1_2 = this.c.f.obtainMessage(10007);
        v1_2.obj = v0_3;
        this.c.f.sendMessage(v1_2);
    }
}

